package com.beamfield.dao.sys;

import com.beamfield.model.TrainInfo;
import com.beamfield.model.TrainInfoExample;
import com.beamfield.modelVo.TrainDetailsVo;
import com.beamfield.modelVo.TrainVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public interface TrainInfoMapper {
    int deleteByPrimaryKey(Long train_id);

    int insert(TrainInfo record);

    int insertSelective(TrainInfo record);

    List<TrainInfo> selectByExample(TrainInfoExample example);

    TrainInfo selectByPrimaryKey(Long train_id);

    int updateByPrimaryKeySelective(TrainInfo record);

    int updateByPrimaryKey(TrainInfo record);

    List<TrainVo> selectByBeamId(@Param("beamId") String beamId,
                                 @Param("offset") String offset,
                                 @Param("limit") String limit,
                                 @Param("trainDate") String trainDate,
                                 @Param("department") String department,
                                 @Param("trainId") String trainId,
                                 @Param("type") String type);

    long countByBeamId(@Param("beamId") String beamId,
                       @Param("trainDate") String trainDate,
                       @Param("department") String department,
                       @Param("trainId") String trainId,
                       @Param("type") String type);

    List<TrainDetailsVo> selectDetailsByTrainId(@Param("trainId") String trainId,
                                                @Param("offset") String offset,
                                                @Param("limit") String limit,
                                                @Param("operatorName") String operatorName,
                                                @Param("workDepartment") String workDepartment);

    long countDetailsByTrainId(@Param("trainId") String trainId,
                               @Param("operatorName") String operatorName,
                               @Param("workDepartment") String workDepartment);

    int logicDeleteTrain(@Param("list") List<Long> idList,@Param("updater") long userId,@Param("updatetime") Date updateDate);

    List<TrainInfo> selectByAttendDeviceId(@Param("dwMachineNumber") String dwMachineNumber);

    int countTrainByMonth(@Param("beamId") Long beamId,@Param("month")String month);
}